package com.suian.spring.invocationhandler;

import com.suian.spring.service.IUserService;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;

@SpringBootTest
class MyLogInvocationHandlerRunner {

    @Autowired
    private IUserService userService;

    @Test
    public void testLog() {
        System.out.println(userService.getAllUsers());
        MyLogInvocationHandler handler = new MyLogInvocationHandler();
        handler.setTarget(userService);
        IUserService userService1 = (IUserService) handler.getProxy();
        System.out.println(userService1.getAllUsers());
    }
}